﻿using ICSharpCode.TextEditor;
using System.Text;

namespace Koala.Pro.CodeGenerator.UI.Common
{
    public sealed class FormatCodeHelper
    {
        public static string CSHARP = "C#";

        public static string TSQL = "SQL";

        public static string VBNET = "VBNET";

        public static string ASPNET = "ASP3/XHTML";

        public static string XML = "XML";

        public static string HTML = "HTML";

        public static string TEXT = "TeX";

        public static string CPPNet = "C++.NET";

        public static string JAVA = "Java";

        public static string JAVASCRIPT = "JavaScript";

        public static string PHP = "PHP";

        public static string BAT = "BAT";

        public static string BOO = "Boo";

        public static string COCO = "Coco";

        public static string[] CodeFormatType = new string[14]
        {
        "ASP3/XHTML", "BAT", "Boo", "Coco", "C++.NET", "C#", "HTML", "Java", "JavaScript", "PHP",
        "TeX", "VBNET", "XML", "SQL"
        };

        public static void FormatText(TextEditorControl editor, string type, string text)
        {
            editor.ShowEOLMarkers = false;
            editor.ShowInvalidLines = false;
            editor.ShowSpaces = false;
            editor.ShowTabs = false;
            editor.SetHighlighting(type);
            editor.Encoding = Encoding.Default;
            editor.Text = text;
        }
    }
}
